//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#ifndef Green_PyStateElement_H
#define Green_PyStateElement_H

#include "pybind11/pybind11.h"

#include "StateElement.h"
#include "ThreadContext.h"

namespace py = pybind11;

namespace Green {

  PYBIND11_MODULE(StateElement, mod) {
    py::class_<StateElement>(mod, "StateElement")
      .def("getName", &StateElement::GetName, py::call_guard<ThreadContextNoAdvance>())
      .def("getStateElementType", &StateElement::GetStateElementType, py::call_guard<ThreadContextNoAdvance>())
      .def("getValues", &StateElement::GetValues, py::call_guard<ThreadContextNoAdvance>())
      .def("getMasks", &StateElement::GetMasks, py::call_guard<ThreadContextNoAdvance>())
      ;

    py::class_<MemoryStateElement, StateElement>(mod, "MemoryStateElement")
      .def("getStartAddress", &MemoryStateElement::GetStartAddress, py::call_guard<ThreadContextNoAdvance>())
      ;

    py::class_<RegisterStateElement, StateElement>(mod, "RegisterStateElement")
      .def("getRegisterIndex", &RegisterStateElement::GetRegisterIndex, py::call_guard<ThreadContextNoAdvance>())
      ;

    py::class_<VmContextStateElement, StateElement>(mod, "VmContextStateElement")
      .def("getRegisterName", &VmContextStateElement::GetRegisterName, py::call_guard<ThreadContextNoAdvance>())
      .def("getRegisterFieldName", &VmContextStateElement::GetRegisterFieldName, py::call_guard<ThreadContextNoAdvance>())
      ;

    py::class_<PrivilegeLevelStateElement, StateElement>(mod, "PrivilegeLevelStateElement")
      ;

    py::class_<PcStateElement, StateElement>(mod, "PcStateElement")
      ;
  }

}

#endif  // Green_PyStateElement_H
